#ifndef REDUCE_COLOR_H
#define REDUCE_COLOR_H

#include <list>
#include <Color/Color.h>
#include <unordered_map>

class ReduceColor
{
public:
    /**
     * @brief 中位分割法
     * @return
     */
    static void MCAReduce(std::list<Color>& in, const std::list<Color>& extraColor, std::unordered_map<uint32_t, Color>& out, std::unordered_map<Color, uint32_t>& colorMap);

private:
    class MCAUtil
    {
    public:
        static bool GetNextSet2Cut(std::list<std::list<Color>>& in, std::list<std::list<Color>>::iterator & out);
        static bool Cut(std::list<Color>& in, std::list<Color>& out1, std::list<Color>& out2);
    };


};


#endif //REDUCE_COLOR_H
